import { VxeGridPropTypes } from "vxe-table";

export const columns: VxeGridPropTypes.Columns = [
    {type: 'checkbox', width: 50,},
    {type: 'seq', title: '序号', treeNode: false, visible: false, width: 60,},
    // {field: 'id', title: 'ID', width: 60, visible: false,},
    // { field: 'qty', title: '数量', width: 110, visible: true, sortable: false, align: 'left',
    //   editRender: {autofocus: '.vxe-input--inner', autoselect: true, immediate: true,}, 
    //   slots: { default: 'qty_edit' },
    // },
    {field: 'code', title: '货物编码', sortable: false, visible: true, minWidth: 120, },
    {field: 'name', title: '货物', sortable: false, minWidth: 160,},
    {field: 'cate.name', title: '类别', sortable: false, minWidth: 120,},
    {field: 'images', title: '图片', sortable: false, visible: false, width: 150, cellRender: {name: 'GoodsImage',},},
    {field: 'unit', title: '单位', visible: true,  sortable: false, width: 60,},
    {field: 'invtQty', title: '库存量', visible: false, sortable: false, width: 90,},
    {field: 'enable', title: '启用', sortable: false, width: 50, formatter: 'formatEnable',},
    {field: 'isGift', title: '赠品', sortable: false, width: 60, formatter: 'formatIsGift',},
    {field: 'price', title: '单价', visible: false, sortable: false, width: 70,},
    {field: 'validAt', title: '保质期天数', visible: false, sortable: false, width: 90,},
    {field: 'creator.name', title: '创建人', visible: true, sortable: false, minWidth: 90,},
    {field: 'memo', title: '备注', visible: true, sortable: false, minWidth: 180,},
    {field: 'createdAt', title: '创建时间', visible: false, sortable: false, width: 140,},
    {field: 'updatedAt', title: '更新时间', visible: false, sortable: false,},
  ];

export const pagerConfig: VxeGridPropTypes.PagerConfig = {
    total: 0,
    currentPage: 1,
    pageSize: 20,
    pageSizes: [20, 50, 100, 200, 500, 1000],
    layouts: ['PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total'],
    pagerCount: 3,
    border: true,
    background: true,
    perfect: true,
};


